package com.huawei.appmarket.service.settings.card;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.os.Handler;
import android.os.Message;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
import com.huawei.appgallery.foundation.account.bean.UserSession;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import com.huawei.appmarket.service.settings.view.activity.SettingReceivePrizeActivity;
import o.AccountBussinessListener;
import o.ccp;
import o.cgz;
import o.der.d;
import o.der.f;
import o.dof;
import o.doo;
import o.eod;
import o.eoj;
import o.evx;

public class SettingReceivePrizeCard extends BaseSettingCard {
    @SuppressLint({"HandlerLeak"})
    private Handler ˏ = new Handler(this) {
        final /* synthetic */ SettingReceivePrizeCard ˎ;

        {
            this.ˎ = r1;
        }

        public void handleMessage(Message message) {
            if (message.what == 4004) {
                this.ˎ.ॱ.startActivity(new Intent(this.ˎ.ॱ, SettingReceivePrizeActivity.class));
            }
        }
    };
    private Context ॱ;

    public SettingReceivePrizeCard(Context context) {
        super(context);
        this.ॱ = context;
    }

    public cgz ˏ(View view) {
        super.ˏ(view);
        ((TextView) view.findViewById(d.ʽʼ)).setText(f.ˋˉ);
        ʽ(view);
        return this;
    }

    public void ˏ(CardBean cardBean) {
        super.ˏ(cardBean);
        this.ˊˋ.setOnClickListener(new evx(this) {
            final /* synthetic */ SettingReceivePrizeCard ॱ;

            {
                this.ॱ = r1;
            }

            public void ˋ(View view) {
                if (!doo.ˊ(this.ॱ.ॱ.getApplicationContext())) {
                    Toast.makeText(this.ॱ.ॱ.getApplicationContext(), f.ʻʽ, 0).show();
                } else if (dof.ˋ(UserSession.getInstance().getAuthAccount())) {
                    eoj.ˋ().ˎ("SettingActivity", new AccountBussinessListener(this) {
                        final /* synthetic */ AnonymousClass4 ˎ;

                        {
                            this.ˎ = r1;
                        }

                        public void onAccountBusinessResult(ccp o_ccp) {
                            if (102 == o_ccp.ˎ) {
                                this.ˎ.ॱ.ˏ.sendEmptyMessage(4004);
                            }
                            eoj.ˋ().ˊ("SettingActivity");
                        }
                    });
                    eod.ॱ(this.ॱ.ॱ);
                } else {
                    this.ॱ.ॱ.startActivity(new Intent(this.ॱ.ॱ, SettingReceivePrizeActivity.class));
                }
            }
        });
    }
}
